package testproject;

import DAO.*;
import java.sql.Date;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.*;
import com.toedter.calendar.JDateChooser;
import java.awt.Rectangle;
import java.text.SimpleDateFormat;

public class InsertVac extends javax.swing.JFrame {

    VacDAO vacdao = new VacDAO();

    public InsertVac() {
        initComponents();
        
        jdVacDate.setEnabled(false);
        jdVacDate.getCalendarButton().setEnabled(true);
        
        lblVacDepNoCheck.setVisible(false);
        lblVacIdCheck.setVisible(false);
        lblVacDesIdCheck.setVisible(false);
        lblVacSecIdCheck.setVisible(false);
        lblVacNoOfCheck.setVisible(false);
        lblVacStatusCheck.setVisible(false);
        lblVacDateCheck.setVisible(false);
        lblVacPriorityCheck.setVisible(false);

        vacdao.loadVacCombobox(cbVacDepNo, cbVacDesId, cbVacSecId);
//        vacdao.loadComboboxDep(cbVacDepNo);

    }

    public void loadVacDepNo() {

        cbVacDepNo.setModel(new DefaultComboBoxModel());
    }

    public void resetVacInsert() {
        txtVacId.setText("");
        cbVacDepNo.setSelectedIndex(0);
        cbVacDesId.setSelectedIndex(0);
        cbVacSecId.setSelectedIndex(0);
        txtVacNoOf.setText("");
        txtVacStatus.setText("");
        jdVacDate.setCalendar(null);
        txtVacPriority.setText("");
    }

    public boolean validateVacInsert() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if (txtVacId.getText().equals("")) {
            txtVacId.requestFocus();
            lblVacIdCheck.setVisible(true);
            return false;
        }
        if (!txtVacId.getText().matches("V{1}[0-9]{3,5}")) {
            txtVacId.requestFocus();
            lblVacIdCheck.setText("Vacancy ID need Follow Rule: V101");
            return false;
        }
        lblVacIdCheck.setVisible(false);
        if (cbVacDepNo.getSelectedIndex() == 0) {
            cbVacDepNo.requestFocus();
            lblVacDepNoCheck.setVisible(true);
            return false;
        }
        lblVacDepNoCheck.setVisible(false);
        if (cbVacSecId.getSelectedIndex() == 0) {
            cbVacSecId.requestFocus();
            lblVacSecIdCheck.setVisible(true);
            return false;
        }
        lblVacSecIdCheck.setVisible(false);
        if (cbVacDesId.getSelectedIndex() == 0) {
            cbVacDesId.requestFocus();
            lblVacDesIdCheck.setVisible(true);
            return false;
        }
        lblVacDesIdCheck.setVisible(false);
        if (txtVacNoOf.getText().equals("")) {
            txtVacNoOf.requestFocus();
            lblVacNoOfCheck.setVisible(true);
            return false;
        }
        lblVacNoOfCheck.setVisible(false);
        if (txtVacStatus.getText().equals("")) {
            txtVacStatus.requestFocus();
            lblVacStatusCheck.setVisible(true);
            return false;
        }
        lblVacStatusCheck.setVisible(false);
        
        if (jdVacDate.getDate() == null) {
            jdVacDate.requestFocus();
            lblVacDateCheck.setVisible(true);
            return false;
        }
        lblVacDateCheck.setVisible(false);
        if (txtVacPriority.getText().equals("")) {
            txtVacPriority.requestFocus();
            lblVacPriorityCheck.setVisible(true);
            return false;
        }
        lblVacPriorityCheck.setVisible(false);
        return true;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        btnVacInsert = new javax.swing.JButton();
        btnVacReset = new javax.swing.JButton();
        btnVacCancel = new javax.swing.JButton();
        txtVacId = new javax.swing.JTextField();
        txtVacNoOf = new javax.swing.JTextField();
        txtVacStatus = new javax.swing.JTextField();
        txtVacPriority = new javax.swing.JTextField();
        cbVacDepNo = new javax.swing.JComboBox();
        cbVacSecId = new javax.swing.JComboBox();
        cbVacDesId = new javax.swing.JComboBox();
        lblVacIdCheck = new javax.swing.JLabel();
        lblVacDepNoCheck = new javax.swing.JLabel();
        lblVacSecIdCheck = new javax.swing.JLabel();
        lblVacDesIdCheck = new javax.swing.JLabel();
        lblVacNoOfCheck = new javax.swing.JLabel();
        lblVacStatusCheck = new javax.swing.JLabel();
        lblVacDateCheck = new javax.swing.JLabel();
        lblVacPriorityCheck = new javax.swing.JLabel();
        jdVacDate = new com.toedter.calendar.JDateChooser();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(102, 102, 255));
        jLabel6.setText("Vacancy Registration");

        jLabel1.setForeground(new java.awt.Color(102, 102, 255));
        jLabel1.setText("Vacancy ID:");

        jLabel5.setForeground(new java.awt.Color(102, 102, 255));
        jLabel5.setText("No Of Vancacy:");

        jLabel2.setForeground(new java.awt.Color(102, 102, 255));
        jLabel2.setText("DeptNo:");

        jLabel7.setForeground(new java.awt.Color(102, 102, 255));
        jLabel7.setText("Status:");

        jLabel3.setForeground(new java.awt.Color(102, 102, 255));
        jLabel3.setText("Section ID:");

        jLabel8.setForeground(new java.awt.Color(102, 102, 255));
        jLabel8.setText("Vacancy Date:");

        jLabel4.setForeground(new java.awt.Color(102, 102, 255));
        jLabel4.setText("Designation ID:");

        jLabel9.setForeground(new java.awt.Color(102, 102, 255));
        jLabel9.setText("Priority:");

        btnVacInsert.setForeground(new java.awt.Color(102, 102, 255));
        btnVacInsert.setText("Insert");
        btnVacInsert.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVacInsertActionPerformed(evt);
            }
        });

        btnVacReset.setForeground(new java.awt.Color(102, 102, 255));
        btnVacReset.setText("Reset");
        btnVacReset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVacResetActionPerformed(evt);
            }
        });

        btnVacCancel.setForeground(new java.awt.Color(102, 102, 255));
        btnVacCancel.setText("Cancel");

        txtVacId.setForeground(new java.awt.Color(102, 102, 255));

        txtVacNoOf.setForeground(new java.awt.Color(102, 102, 255));

        txtVacStatus.setForeground(new java.awt.Color(102, 102, 255));

        txtVacPriority.setForeground(new java.awt.Color(102, 102, 255));

        cbVacDepNo.setForeground(new java.awt.Color(102, 102, 255));
        cbVacDepNo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        cbVacSecId.setForeground(new java.awt.Color(102, 102, 255));
        cbVacSecId.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        cbVacDesId.setForeground(new java.awt.Color(102, 102, 255));
        cbVacDesId.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        lblVacIdCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacIdCheck.setText("Vacancy ID cannot be blank");

        lblVacDepNoCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacDepNoCheck.setText("Please Choice one DeptNo");

        lblVacSecIdCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacSecIdCheck.setText("Please Choice one Section ID");

        lblVacDesIdCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacDesIdCheck.setText("Please Choice one Designation ID");

        lblVacNoOfCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacNoOfCheck.setText("No Of Vacancy cannot be blank");

        lblVacStatusCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacStatusCheck.setText("Status cannot be blank");

        lblVacDateCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacDateCheck.setText("Vacancy Date cannot be blank");

        lblVacPriorityCheck.setForeground(new java.awt.Color(255, 0, 51));
        lblVacPriorityCheck.setText("priority cannot be blank");

        jdVacDate.setDateFormatString("yyyy-dd-MM");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(245, 245, 245)
                        .addComponent(jLabel6)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabel4)
                            .addComponent(jLabel3))
                        .addGap(22, 22, 22)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(lblVacIdCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblVacNoOfCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(lblVacDepNoCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblVacStatusCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(lblVacSecIdCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblVacDateCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(lblVacDesIdCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblVacPriorityCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(cbVacDepNo, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(cbVacSecId, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(cbVacDesId, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(61, 61, 61)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel5)
                                            .addComponent(jLabel7)
                                            .addComponent(jLabel9)
                                            .addComponent(jLabel8))
                                        .addGap(26, 26, 26)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(txtVacPriority, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                                            .addComponent(txtVacStatus, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                                            .addComponent(txtVacNoOf, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                                            .addComponent(jdVacDate, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)))
                                    .addComponent(txtVacId, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(0, 0, Short.MAX_VALUE)))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(btnVacInsert, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addComponent(btnVacReset, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(32, 32, 32)
                .addComponent(btnVacCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(154, 154, 154))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jLabel6)
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtVacId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(txtVacNoOf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(lblVacIdCheck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblVacNoOfCheck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2)
                        .addComponent(cbVacDepNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(txtVacStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(lblVacDepNoCheck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblVacStatusCheck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel3)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cbVacSecId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel8))
                    .addComponent(jdVacDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblVacSecIdCheck)
                    .addComponent(lblVacDateCheck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel4)
                    .addComponent(jLabel9)
                    .addComponent(txtVacPriority, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbVacDesId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(17, 17, 17)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblVacDesIdCheck)
                    .addComponent(lblVacPriorityCheck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVacCancel)
                    .addComponent(btnVacInsert)
                    .addComponent(btnVacReset))
                .addContainerGap(33, Short.MAX_VALUE))
        );

        cbVacDepNo.getAccessibleContext().setAccessibleDescription("");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 4, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnVacInsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVacInsertActionPerformed
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if (validateVacInsert()) {
            
            String VacID = txtVacId.getText().trim();
            int DepNo = Integer.parseInt(cbVacDepNo.getSelectedItem().toString().trim());
            String SecID = cbVacSecId.getSelectedItem().toString().trim();
            String DesignID = cbVacDesId.getSelectedItem().toString().trim();
            int NoofVac = Integer.parseInt(txtVacNoOf.getText().trim());
            String Status = txtVacStatus.getText();
            String VacDate =   sdf.format(jdVacDate.getDate());
            String Priority = txtVacPriority.getText().trim();

            Vector v = new Vector();
            v.add(VacID);
            v.add(DepNo);
            v.add(SecID);
            v.add(DesignID);
            v.add(NoofVac);
            v.add(Status);
            v.add(VacDate);
            v.add(Priority);

            if (!validateVacInsert()) {
                return;
            }

            if (!vacdao.insertVac(v)) {
                JOptionPane.showMessageDialog(this, "Cannot Insert! Please try again!", "INSERT VACANCIES", JOptionPane.ERROR_MESSAGE);
                return;
            }
            JOptionPane.showMessageDialog(this, "Insert new VACANCIES successfully!", "INSERT VACANCIES", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_btnVacInsertActionPerformed

    private void btnVacResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVacResetActionPerformed
        resetVacInsert();
    }//GEN-LAST:event_btnVacResetActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(InsertVac.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(InsertVac.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(InsertVac.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(InsertVac.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new InsertVac().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnVacCancel;
    private javax.swing.JButton btnVacInsert;
    private javax.swing.JButton btnVacReset;
    private javax.swing.JComboBox cbVacDepNo;
    private javax.swing.JComboBox cbVacDesId;
    private javax.swing.JComboBox cbVacSecId;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private com.toedter.calendar.JDateChooser jdVacDate;
    private javax.swing.JLabel lblVacDateCheck;
    private javax.swing.JLabel lblVacDepNoCheck;
    private javax.swing.JLabel lblVacDesIdCheck;
    private javax.swing.JLabel lblVacIdCheck;
    private javax.swing.JLabel lblVacNoOfCheck;
    private javax.swing.JLabel lblVacPriorityCheck;
    private javax.swing.JLabel lblVacSecIdCheck;
    private javax.swing.JLabel lblVacStatusCheck;
    private javax.swing.JTextField txtVacId;
    private javax.swing.JTextField txtVacNoOf;
    private javax.swing.JTextField txtVacPriority;
    private javax.swing.JTextField txtVacStatus;
    // End of variables declaration//GEN-END:variables
}
